import { createRouter, createWebHistory } from "vue-router";

import Home from "../views/home/index.vue";
import HomeBody from "../views/home/components/body.vue";
import Women from "../views/women/index.vue";
import InTown from "../views/inTown/index.vue";
import Men from "../views/men/index.vue";

import Details from "../views/components/details.vue";

import Login from "../views/login/index.vue";

import Back from "../views/back/index.vue";

import BackHome from "../views/back/home/index.vue";
import BackMen from "../views/back/men/index.vue";
import BackWomen from "../views/back/women/index.vue";
import BackInTown from "../views/back/inTown/index.vue";
import Profile from "@/views/back/profile/index.vue"

import ModelDetails from "../views/back/components/profile.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/login",
      component: Login,
    },
    {
      path: "/back",
      component: Back,
      redirect: "/back/home",
      children: [
        { path: "home", component: BackHome },
        { path: "men", component: BackMen },
        { path: "women", component: BackWomen },
        { path: "inTown", component: BackInTown },
        {path:'details/:id',component:ModelDetails},
        { path: "profile", component: Profile },
      ],
    },
    {
      path: "/",
      name: "home",
      component: Home,
      redirect: "/home",
      children: [
        {
          path: "home",
          component: HomeBody,
        },
        {
          path: "women",
          component: Women,
        },
        {
          path: "inTown",
          component: InTown,
        },
        {
          path: "men",
          component: Men,
        },
        {
          path: "details/:id",
          component: Details,
        },
      ],
    },
  ],
});

export default router;
